
# def STE_full_case(ts1, ts2, l, m, step=1):
# 	N = len(ts1)
#
# 	x = []
# 	y = []
#
# 	for i in range(N - l * (m - 1)):
# 		k_x = array2index(np.argsort(ts1[i:i + l * (m - 1) + 1:l]))
# 		k_y = array2index(np.argsort(ts2[i:i + l * (m - 1) + 1:l]))
# 		x.append(k_x)
# 		y.append(k_y)
#
# 	sequence_x1 = x[step:]
# 	sequence_x0 = x[:-step]
# 	sequence_y0 = y[:-step]
# 	Nx1x0y0 = defaultdict(int)
# 	Nx1x0 = defaultdict(int)
# 	Nx0y0 = defaultdict(int)
# 	Nx0 = defaultdict(int)
# 	N = len(sequence_x1)
#
# 	for i in range(N):
# 		Nx1x0y0[(sequence_x1[i], sequence_x0[i], sequence_y0[i])] += 1
# 		Nx1x0[(sequence_x1[i], sequence_x0[i])] += 1
# 		Nx0y0[(sequence_x0[i], sequence_y0[i])] += 1
# 		Nx0[sequence_x0[i]] += 1
#
# 	# print(Nx1x0y0, Nx1x0, Nx0y0, Nx0)
#
# 	px1dx0y0 = defaultdict(int)
# 	px1dx0 = defaultdict(int)
# 	px1x0y0 = defaultdict(int)
#
# 	for x0 in np.unique(sequence_x0):
# 		for y0 in np.unique(sequence_y0):
# 			for x1 in np.unique(sequence_x1):
# 				if Nx1x0y0[(x1, x0, y0)] != 0:
# 					if Nx0y0[(x0, y0)] != 0:
# 						px1dx0y0[(x1, x0, y0)] = Nx1x0y0[(x1, x0, y0)] / Nx0y0[(x0, y0)]
# 					px1x0y0[(x1, x0, y0)] = Nx1x0y0[(x1, x0, y0)] / N
# 		for x1 in np.unique(sequence_x1):
# 			if Nx1x0[(x1, x0)] != 0 and Nx0[x0] != 0:
# 				px1dx0[(x1, x0)] = Nx1x0[(x1, x0)] / Nx0[x0]
# 	# print('N calculation done')
# 	Tyx = 0
# 	for x0 in np.unique(sequence_x0):
# 		for y0 in np.unique(sequence_y0):
# 			for x1 in np.unique(sequence_x1):
# 				if px1dx0[(x1, x0)] != 0 and px1x0y0[(x1, x0, y0)] != 0:
# 					Tyx += px1x0y0[(x1, x0, y0)] * np.log2(px1dx0y0[(x1, x0, y0)] / px1dx0[(x1, x0)])
# 	# print('Tyx calculation done')
# 	return Tyx